<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>学生注册</title>
  <script>
      function getFrom() {
          var stdname=document.getElementById("name").value;
          var sex=document.getElementsByName("sex");
          var strsex="";
          for(var i=0;i<sex.length;i++){
              if(sex[i].checked){
                  strsex=sex[i].value;
              }
          }
          var birthday=document.getElementById("birthday").value;
          var school=document.getElementById("school").value;
          var profession=document.getElementById("profession").value;
          var ti=document.getElementsByName("ti");
          var strti="";
          for(var i=0;i<ti.length;i++){
              if(ti[i].checked){
                  strti=ti[i].value;
              }
          }
          var password=document.getElementById("password").value;
          var mytext=document.getElementById("mytext").value;
          document.write("姓名："+stdname+"<br>"+"性别："+strsex+"<br>"+"出生日期："+birthday+"<br>"+"学校："+school+"<br>"+"专业："+profession+"<br>"+"体育特长："+strti+"<br>"+"个人简介："+mytext);
      }
  </script>
</head>
<body>
<h2 style="text-align: center">学生注册</h2>
<form action="jsdate.jsp" method="post" name="form1">
  <table style="margin: 0 auto">
    <tr>
      <td>姓名：</td>
      <td><input type="text" name="name" id="name" style="width: 170px"></td>
    </tr>
    <tr>
      <td>性别：</td>
      <td>
        <input type="radio" name="sex"  value="男">男
        <input type="radio" name="sex"  value="女">女
      </td>
    </tr>
    <tr>
      <td>出生日期：</td>
      <td><input type="date" name="birthday" id="birthday" style="width: 170px"></td>
    </tr>
    <tr>
      <td>学校：</td>
      <td><input type="text" name="school" id="school" style="width: 170px"></td>
    </tr>
    <tr>
      <td>专业：</td>
      <td>
        <select style="width: 170px;height: 25px" name="profession" id="profession">
          <option value="计算机">计算机科学与技术</option>
          <option value="计开发">计开发</option>
          <option value="计测试">计测试</option>
          <option value="物联网">物联网</option>
        </select>
      </td>
    </tr>
    <tr>
      <td>体育特长：</td>
      <td>
        <input type="checkbox" name="ti" value="篮球">篮球
        <input type="checkbox" name="ti" value="足球">足球
        <input type="checkbox" name="ti" value="羽毛球">羽毛球
        <input type="checkbox" name="ti" value="乒乓球">乒乓球
      </td>
    </tr>
    <tr>
      <td>上传照片：</td>
      <td><input type="file"></td>
    </tr>
    <tr>
      <td>密码：</td>
      <td><input type="password" name="password"  id="password" style="width: 170px"></td>
    </tr>
    <tr>
      <td>个人简介：</td>
      <td><textarea style="width: 170px" name="mytext" id="mytext"> </textarea></td>
    </tr>
    <tr >
      <td style="text-align: center">
        <button type="button" onclick="getFrom()">提交</button>
      </td>
      <td style="text-align: center">
        <button type="reset" >重置</button>
      </td>
    </tr>
  </table>
</form>
</body>
</html>
